import request from '@/utils/request';

export type CommentParamsType = {
  type: 'a' | 'c';
  source: string;
};
/** 根据id获取评论数据 */
export const getCommentsByIdAPI = (params: CommentParamsType) => {
  return request({
    url: '/v1_0/comments',
    params,
  });
};

export type SendCommentParamsType = {
  target: string;
  content: string;
  art_id?: string;
};
//   2. 封装API
export const sendCommentByIdAPI = (data: SendCommentParamsType) => {
  return request({
    url: '/v1_0/comments',
    method: 'post',
    data,
  });
};
